﻿
namespace SimpleORM
{
    public class SelectObjectItem
    {
        #region Properties

        public IScriptFactory Factory { get; set; }
        public string FromName { get; set; }
        public string MemberName { get; set; }
        public string AliasName { get; set; }

        #endregion

        #region Ctor

        public SelectObjectItem()
        {
        }

        #endregion

        #region Methods

        #region Methods - Public

        public IScriptFactory GetItem()
        {
            return Factory.Constant(FromName).
                           Stress().
                           Concat(Factory.
                           Constant(MemberName).
                           Stress(), ".").
                           As(Factory.
                           Constant(AliasName).
                           Stress());
        }

        public IScriptFactory GetItemName()
        {
            return Factory.Constant(FromName).
                           Stress().
                           Concat(Factory.
                           Constant(MemberName).
                           Stress(), ".");
        }

        #endregion

        #endregion
    }
}
